package servlet.home;

import com.alibaba.fastjson.JSONObject;
import po.User;
import utils.ResultData;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 *      退出登录
 */
@WebServlet(urlPatterns = "/out")
public class Out extends HttpServlet  {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获取session信息
        req.getSession().removeAttribute("userKey");
//        User user = (User)session.getAttribute("userKey");
        //跳转login页面
        resp.sendRedirect("/login.html");

    }
}
